﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Text;
using System.IO;

namespace AMOOF {
    static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
            bool testmode = false;

            if (testmode) {
                string str = Directory.GetCurrentDirectory();
                DirectoryInfo info = Directory.GetParent(str);
                Directory.SetCurrentDirectory(info.Parent.FullName);
                MessageBox.Show(Directory.GetCurrentDirectory());
            }
            else {
                Directory.SetCurrentDirectory(Directory.GetCurrentDirectory());
            }




            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormAMOOF());
        }

        public static void log(string text) {
            try {
                string dir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
                StreamWriter w = File.AppendText(dir + @"\errors.log");



                w.Write("\r\n");
                w.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(),
                    DateTime.Now.ToLongDateString());
                w.WriteLine("  :");
                w.WriteLine("  :{0}", text);
                w.WriteLine("-------------------------------");
                // Update the underlying file.
                w.Flush();
            }
            catch (Exception ex) {
                
            }
            
        }
    }
}
